<?php
//引入mysql.php 数据库

include('./mysql.php');

//获取ajax 请求的函数

$fn = $_GET['fn'];
$fn();

//添加函数
function add(){
    //1 获取函数
    $tel = $_GET['tel'];
    
    $pass = $_GET['pass'];

    //2 拼接数据
$sql = " select * from  user where  tel ='$tel' && pass='$pass' ";
$link = mysqli_connect('127.0.0.1','root','root','2020'); 
$res = mysqli_query($link,$sql);

     if(mysqli_num_rows($res) > 0){
         echo json_encode([
             'stateCode' =>200,
             'state' => 'success',
             'date' =>[]
         ]);

     }else{
        echo json_encode([

            'stateCode' =>202,
            'state'=>'failer',
            'data' =>[]
        ]);
     }

}



?>